<!DOCTYPE html>
<html lang="zh-cn">

    <head>
        <meta charset="UTF-8">
        <title>
            体检报告
        </title>
        <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
        <meta content="no" name="apple-mobile-web-app-capable" />
        <meta content="black" name="apple-mobile-web-app-status-bar-style" />
        <meta content="telephone=no" name="format-detection" />
        <link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css">
        <script src="__PUBLIC__/js/jquery.js" type="text/javascript"></script>
        <script src="__PUBLIC__/js/jquery-add-yu.js" type="text/javascript"></script>
    </head>

    <body>
        <div class="header">
        </div>
        <header>
            <b>
            </b>
            <strong class="s0{$user['sex']}">
                {$user['name']}<empty name="user.age">

                                    <else />
                                    |{$user['age']}岁
                                </empty>
            </strong>
            <span>
                体检报告总览
            </span>
        </header>
        <img id="switcher" class="switcher" src="__PUBLIC__/images/switcher.png" alt="" />
        <section id="type-sct">
            <ul>
                <volist name="piclist" id="vo">
                    <li>
                        <img src="__PUBLIC__/images/ks/{$vo}" alt="" />
                        <span>
                            {$name[$i-1]}
                        </span>
                    </li>
                </volist>
            </ul>
        </section>
        <section id="detail-sct">
            <ul>
                <volist name="name" id="vo" key="idx">
                    <li class="item">
                        <h3>
                            {$vo}
                        </h3>
                        <assign name="itemGroup" value="$items[$idx - 1]"/>
                        <foreach name="itemGroup" item="voo" key="offsets">
                            <php>
                                $classCss = "with-url";
                                if(($url = ReportItemModel::getUrl($voo['itemname'],$_GET["reportid"],$voo["result"])) === false){
                                    $classCss = "no-url";
                                }elseif($url ===true){
                                }else{
                                }

                            </php>
                            <if condition="$voo.type eq 1">
                                <div class="or-li {$classCss}" meurl=
                                        '{$url}'>
                                    <span class="l">
                                        <strong>
                                            {$voo.itemname}
                                        </strong>
                                        <b>
                                            正常值（{$voo.normal}）
                                        </b>
                                    </span>
                                    <span class="r rr">
                                        <p class="w1">
                                            <span class="x1">
                                                <b style="left:70%;">
                                                    {$voo.result}
                                                    <br>
                                                    <br>
                                                    <br>
                                                    正常
                                                </b>
                                            </span>
                                            <!-- 30/(41-0)=x -->
                                        </p>
                                    </span>
                                </div>
                            </if>
                            <if condition="$voo.type eq 2">
                                <div class="or-li {$classCss}">
                                    <span class="l">
                                        <strong class="strong">
                                            {$voo.itemname}
                                        </strong>
                                        <b>
                                            正常值（{$voo.normal}）
                                        </b>
                                    </span>
                                    <span class="r rr">
                                        <p class="w1">
                                            <span class="x2">
                                                <b style="left:73%;">
                                                    {$voo.result}
                                                    <br>
                                                    <br>
                                                    <br>
                                                    高
                                                </b>
                                            </span>
                                            <!-- 30/(41-0)=x -->
                                        </p>
                                    </span>
                                </div>
                            </if>
                            <if condition="$voo.type eq 3">
                                <div class="or-li {$classCss}" meurl=
                                        '{$url}'>
                                    <span class="l">
                                        <strong>
                                            {$voo.itemname}
                                        </strong>
                                        <b>
                                            正常值
                                           （{$voo.normal}）
                                        </b>
                                    </span>
                                    <span class="r rr">
                                        <p class="w2">
                                            <span class="x4">
                                            </span>
                                            <span class="x1">
                                                <b style="left:{$voo.rang}%;">
                                                    {$voo.result}
                                                    <br>
                                                    <br>
                                                    <br>
                                                    正常
                                                </b>
                                            </span>
                                            <!-- 95/(150-40)=x -->
                                        </p>
                                    </span>
                                </div>
                            </if>
                            <if condition="$voo.type eq 4">
                                <div class="or-li {$classCss}" meurl=
                                        '{$url}'>
                                    <span class="l">
                                        <strong class="strong">
                                            {$voo.itemname}
                                        </strong>
                                        <b>
                                            正常值（{$voo.normal}）
                                        </b>
                                    </span>
                                    <span class="r rr">
                                        <p class="w2">
                                            <span class="x3">
                                                {$voo.result}
                                                <br>
                                                <br>
                                                <br>
                                                低
                                            </span>
                                        </p>
                                    </span>
                                </div>
                            </if>
                            <if condition="$voo.type eq 5">
                                <div class="or-li {$classCss}" meurl=
                                        '{$url}'>
                                    <span class="l">
                                        <strong class="strong">
                                            {$voo.itemname}
                                        </strong>
                                        <b>
                                            正常值（{$voo.normal}）
                                        </b>
                                    </span>
                                    <span class="r rr">
                                        <p class="w2">
                                            <span class="x2">
                                                {$voo.result}
                                                <br>
                                                <br>
                                                <br>
                                                高
                                            </span>
                                        </p>
                                    </span>
                                </div>
                            </if>
                            <if condition="$voo.type eq 6">
                                <?php if(strlen($voo["result"])>150){ ?>
                                     <div class="or-li {$classCss}" meurl=
                                        '{$url}' style="height: 65px;">
                                 <?php }else{?>
                                    <div class="or-li {$classCss}" meurl=
                                            '{$url}'>
                                 <?php }?>

                                    <span class="l">
                                        <strong>
                                            {$voo.itemname}
                                        </strong>
                                        <b>
                                            <empty name="voo.normal">{$voo.unit}<else /><if condition="$voo.normal eq '~'">{$voo.unit}<else />{$voo.normal}</if></empty>
                                        </b>
                                    </span>
                                    <span class="r rr">
                                        <?php if(strlen($voo["result"])>50){ ?>
                                            <span class="spa1" style="font-size:12px;white-space:normal;word-break:break-all;line-height: 16px;background:url(__PUBLIC__/images/zb-jt3.png) no-repeat 0px 4px;background-size: 8px;">
                                                <?=$voo["result"]?>
                                            </span>
                                        <?php }else{?>
                                             <span class="spa1">
                                                <?=$voo["result"]?>
                                            </span>
                                        <?php }?>
                                    </span>
                                </div>
                            </if>
                            <if condition="$voo.type eq 7">
                                <div class="or-li {$classCss}" meurl=
                                        '{$url}' style="height: 50px;">
                                    <span class="l">
                                        <strong class="strong">
                                            {$voo.itemname}
                                        </strong>
                                        <b>
                                            <empty name="voo.normal">{$voo.unit}<else /><if condition="$voo.normal eq '~'">{$voo.unit}<else />{$voo.normal}</if></empty>
                                        </b>
                                    </span>
                                    <span class="r rr">
                                        <?php if(strlen($voo["result"])>50){ ?>
                                            <span class="spa2" style="font-size:12px;white-space:normal;word-break:break-all;line-height: 16px;background:url(__PUBLIC__/images/zb-jt4.png) no-repeat 0px 4px;background-size: 8px;">
                                                <?=$voo["result"]?>
                                            </span>
                                        <?php }else{?>
                                             <span class="spa2">
                                                <?=$voo["result"]?>
                                            </span>
                                        <?php }?>
                                    </span>
                                </div>
                            </if>
                        </foreach>
                    </li>
                </volist>
                <!-- <li class="item">
                    <div class="ys">
                        {$zj}
                    </div>
                </li> -->
            </ul>
        </section>
        <script src="__PUBLIC__/js/jquery.touchwipe.min.js">
        </script>
        <script>
	$(function () {
		$(window).resize(function(){
			$('#type-sct').css('height', $(window).height() - 45);
		});
		$('#type-sct').css('height', $(window).height() - 45);
		$('#type-sct').on('touchmove', function (e) {
			e.stopPropagation();
		});
		$('#type-sct ul li').on('click', function (e) {
			var $oT
				, $body
				, iTop
				;
			$body = $('html, body');
			if(e.target.nodeName == 'LI') {
				$oT = $(e.target);
			} else if(e.target.nodeName == 'SPAN' || e.target.nodeName == 'IMG') {
				$oT = $(e.target).parent('li');
				$(this).addClass("active").siblings().removeClass("active");
			}
//			console.log($('#type-sct ul li').index($oT));
//			console.log($('#detail-sct ul li.item').eq($('#type-sct ul li').index($oT)).offset().top);
			iTop = $('#detail-sct ul li.item').eq($('#type-sct ul li').index($oT)).offset().top;
			$body.animate({
				scrollTop: iTop - 45 // 第一个元素位置45
			}, 500);
			$('#type-sct').animate({width: "0px"}, 400);
			$('#switcher').animate({right: "5px"}, 400);
			return false;

		});

		$('#type-sct').animate({width: "0px"}, 800);
		$('#switcher').animate({right: "5px"}, 800);
		$('#switcher').click(function() {
			if($('#switcher').css("right")=="120px"){
				$('#type-sct').animate({width: "0px"}, 500);
				$('#switcher').animate({right: "5px"}, 500);
			}else{

				$('#type-sct').animate({width: "115px"}, 500);
				$('#switcher').animate({right: "120px"}, 500);
			}
		});

			$("body").touchwipe({
			 wipeLeft: function() {


						$('#type-sct').animate({
							width: "115px"
						}, 500);
						$('#switcher').animate({
							right: "120px"
						}, 500);

				 },
			 wipeRight: function() {

						$('#type-sct').animate({
							width: "0px"
						}, 500);
						$('#switcher').animate({
							right: "5px"
						}, 500);

				},
			 min_move_x: 10,
			 min_move_y: 10,
			 preventDefaultEvents: false
		});
	});
</script>
    </body>

</html>